<template>
	<view>
		<up-popup :show="show" @close="close" mode="bottom" :safeAreaInsetBottom="false" bgColor="transparent">
			<view class="good-box fc-ac px-50" :style="{'min-height':height+'rpx'}">
				<view class="w-100 good-border"></view>
				<image style="width: 100%;height: 32rpx;min-height: 32rpx;" src="/static/icon/public/base-popup.png" mode=""></image>
				
				<!-- 标题 -->
				<view v-if="['yuanbao','yuanqi','leitai','yifan','chouka'].includes(type)" class="color pt-60 fs-42 t-c">
					¥{{coupon.coupon_id? priceConversion(order_info.order_zhe_total) : priceConversion(order_info.order_total)}}
				</view>
				<view v-if="['shangcheng'].includes(type)" class="color pt-60 fs-42 t-c">
					¥{{priceConversion(order_info.pay_price)}}
				</view>
				<view v-if="['tihuo'].includes(type)" class="color pt-60 fs-42 t-c">
					发货确认
				</view>
				
				
				<!-- 商品列表 -->
				<template v-if="['yuanbao','yuanqi','leitai','yifan','chouka'].includes(type)">
					<view v-if="order_info.goods" class="fr-ac-jsb w-100 mt-60 pb-30 u-border-bottom" style="border-color: var(--gray-line) !important;">
						<view class="mr-40 fr-ac">
							<image style="width: 80rpx;height: 80rpx;" :src="order_info.goods.imgurl_detail || order_info.goods.imgurl" mode="widthFix"></image>
							<view class="ml-15 flex-1">
								<view class="ellipsis-1 op-90">
									{{order_info.goods.title}}
								</view>
								<view class="fr-ac mt-10">
									<view class="color">
										¥{{order_info.goods.price}}
									</view>
									<text v-if="order_info.goods.struck_price > 0" class="fs-24 op-50 ml-10" style="text-decoration: line-through;">
										¥{{order_info.goods.struck_price}}
									</text>
								</view>
							</view>
						</view>
						<view class="ml-20">
							<cut-corner :arrow="3" clipSize="8rpx">
								<view class="color fr-ac-jc fs-24" style="width: 54rpx;height: 50rpx;background-color: #215665;">
									x{{goods_num}}
								</view>
							</cut-corner>
						</view>
					</view>
				</template>
				
				<!-- 商品列表 可选数量 -->
				<template v-if="['shangcheng'].includes(type)">
					<view v-if="order_info.goods" class="fr-ac-jsb w-100 mt-60 pb-30 u-border-bottom" style="border-color: var(--gray-line) !important;">
						<view class="mr-40 fr-ac">
							<image style="width: 80rpx;height: 80rpx;" :src="order_info.goods.pic" mode="widthFix"></image>
							<view class="ml-15 flex-1">
								<view class="ellipsis-1 op-90">
									{{ order_info.goods.goods_name }}
								</view>
								<view class="fr-ac mt-10">
									<view class="color">
										¥{{order_info.goods.price}}
									</view>
									<text v-if="order_info.goods.struck_price > 0" class="fs-24 op-50 ml-10" style="text-decoration: line-through;">
										¥{{order_info.goods.struck_price}}
									</text>
								</view>
							</view>
						</view>
						<view class="ml-20">
							<up-number-box
								:min="1"
								:max="50"
								v-model="goods_count" 
								@change="valChange($event,item)"
								button-size="0"
								:color="publicStyles['--color']"
								bgColor="transparent"
								inputWidth="18"
								:iconStyle="{
									'color': publicStyles['--color'],
									'background': 'transparent',
									'font-size': '24rpx',
								}"
							>
							</up-number-box>
							<!-- <cut-corner :arrow="3" clipSize="8rpx">
								<view class="color fr-ac-jc fs-24" style="width: 54rpx;height: 50rpx;background-color: #215665;">
									x{{goods_count}}
								</view>
							</cut-corner> -->
						</view>
					</view>
				</template>
				
				
				<!-- 优惠券 -->
				<template v-if="['yuanbao','chouka','leitai','yifan'].includes(type)">
					<view @click="couponChoose" class="w-100 fr-ac u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="op-90">
							优惠券
						</view>
						<view v-if="coupon.id" class="flex-1 op-50 ml-auto mx-10 t-r ellipsis-1">
							{{coupon.title}}
						</view>
						<view v-else class="flex-1 color ml-auto mx-10 t-r ellipsis-1">
							选择优惠券
						</view>
						<image class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/right-fill.png" mode=""></image>
					</view>
				</template>
				
				<!-- 充值金额选择 -->
				<template v-if="['chongzhi'].includes(type)">
					<view class="gap-30 mt-60 pb-30" style="display: grid;grid-template-columns: repeat(3,1fr);">
						<view @click="recharge_current = index" :class="recharge_current == index?'':'op-50'" class="public-img-4 fc-ac-jc" style="width: 186rpx;height: 186rpx;" v-for="(item,index) in recharge_list" :key="index">
							<view class="fr-ac">
								<image style="width: 32rpx;height: 32rpx;" src="/static/icon/public/yuan-bao.png" mode=""></image>
								<view class="ml-5 fs-26">
									{{ item.num }}精粹
								</view>
							</view>
							<view class="mt-5 color fs-22">
								赠{{ item.give_num }}精粹
							</view>
							<view class="mt-15 op-50">
								¥{{ item.name }}
							</view>
						</view>
					</view>
					
					<view class="w-100 fr-ac u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="op-90">
							自定义金额
						</view>
						<input v-model="recharge_num" class="flex-1 ml-40" type="number" placeholder="请输入充值金额" />
					</view>
				</template>
				
				
				
				<!-- 提货商品列表 -->
				<template v-if="['tihuo'].includes(type)">
					<scroll-view class="mt-60 u-border-bottom pb-30" style="width: 650rpx;border-color: var(--gray-line) !important;" scroll-x="true" >
						<view class="fr-ac">
							<view class="mr-40 fr-ac" v-for="(item,index) in take_goods" :key="index">
								<image style="width: 80rpx;height: 80rpx;" :src="item.goodslist_imgurl" mode="widthFix"></image>
								<view class="ml-15 flex-1">
									<view class="ellipsis-1 op-90">
										{{item.goodslist_title}}
									</view>
									<view class="fr-ac mt-10">
										<view class="color">
											¥{{priceConversion(item.goodslist_money)}}
										</view>
										<view class="ml-20">
											<cut-corner :arrow="3" clipSize="8rpx">
												<view class="color fr-ac-jc fs-24" style="width: 42rpx;height: 36rpx;background-color: #215665;">
													x{{item.count}}
												</view>
											</cut-corner>
										</view>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</template>
				
				<!-- 运费相关 -->
				<template v-if="['shangcheng'].includes(type)">
					<view class="w-100 fr-ac u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="op-90">
							运费
						</view>
						<!-- <view class="op-50 ml-10">
							满20件包邮
						</view> -->
						<view class="color ml-auto">
							¥{{ order_info.goods.freight }}
						</view>
					</view>
				</template>
					
				<!-- 收货地址 -->
				<template v-if="['tihuo','shangcheng'].includes(type)">
					<view @click="addressChoose" class="w-100 fr-ac u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="op-90">
							{{address.name || '地址'}}
						</view>
						<view v-if="!address.id" class="flex-1 color ml-auto mx-10 t-r ellipsis-1">
							选择地址
						</view>
						<view v-else class="flex-1 op-50 ml-auto mx-10 t-r ellipsis-1">
							{{address.mobile}}{{address.province}}{{address.county}}{{address.city}}{{address.address}}
						</view>
						<image class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/right-fill.png" mode=""></image>
					</view>
				</template>
				
				
				<!-- 精粹抵扣 -->
				<view v-if="['yuanbao','tihuo','chouka','shangcheng','leitai','yifan'].includes(type)" @click="use_integral_isChange" class="w-100 fr-ac u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
					<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/yuan-bao.png" mode=""></image>
					<view class="flex-1 op-90 mx-20">
						使用精粹抵扣{{order_info.use_integral}}(剩余:{{order_info.integral}}个)
					</view>
					<image v-if="use_integral_is" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
					<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
				</view>
				<!-- 精气抵扣 -->
				<view v-if="['yuanqi'].includes(type)" class="w-100 fr-ac u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
					<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/yuan-qi.png" mode=""></image>
					<view class="flex-1 op-90 mx-20">
						使用精气抵扣{{order_info.use_score}}（剩余{{order_info.score}}个）
					</view>
					<image v-if="use_integral_is" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
					<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
				</view>
				
				
				
				
				
				
				
				
				
				
				<!-- 支付渠道 -->
				<template v-if="['yuanbao','chongzhi','tihuo','chouka','shangcheng'].includes(type)">
					<view @click="payChange(3)" v-if="pay_type.wxpay_app && pay_type.wxpay_app.is_open == 1" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/wx.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								微信支付
							</view>
							<image v-if="pay_current == 3" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(2)" v-if="pay_type.alipay && pay_type.alipay.is_open==1" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/zfb.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								支付宝支付
							</view>
							<image v-if="pay_current == 2" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(37)" v-if="pay_type.epay && pay_type.epay.is_open == 1 && pay_type.epay.pay_type.includes('bank')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/ysf.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								网银支付
							</view>
							<image v-if="pay_current == 37" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(44)" v-if="pay_type.hfbpay && pay_type.hfbpay.is_open == 1 && pay_type.hfbpay.pay_type.includes('bank')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/ysf.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								云闪付收银台
							</view>
							<image v-if="pay_current == 44" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(40)" v-if="pay_type.hellopay && pay_type.hellopay.is_open == 1" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/zfb.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								支付宝
							</view>
							<image v-if="pay_current == 40" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(42)" v-if="pay_type.zfb1pay && pay_type.zfb1pay.is_open == 1" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/ysf.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								支付宝支付1
							</view>
							<image v-if="pay_current == 42" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(33)" v-if="pay_type.epay && pay_type.epay.is_open==1  && pay_type.epay.pay_type.includes('wechat')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/wx.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								微信支付[Epay]
							</view>
							<image v-if="pay_current == 33" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(22)" v-if="pay_type.epay && pay_type.epay.is_open==1 && pay_type.epay.pay_type.includes('alipay')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/zfb.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								支付宝支付[Epay]
							</view>
							<image v-if="pay_current == 22" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(38)" v-if="pay_type.hfpay && pay_type.hfpay.is_open == 1" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/yhk.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								快捷支付
							</view>
							<image v-if="pay_current == 38" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(41)" v-if="pay_type.hfbpay && pay_type.hfbpay.is_open == 1 && pay_type.hfbpay.pay_type.includes('quick')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/yhk.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								快捷支付
							</view>
							<image v-if="pay_current == 41" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(35)" v-if="pay_type.yfbpay && pay_type.yfbpay.is_open==1  && pay_type.yfbpay.pay_type.includes('wechat')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/wx.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								微信支付[Yfbpay]
							</view>
							<image v-if="pay_current == 35" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(25)" v-if="pay_type.yfbpay && pay_type.yfbpay.is_open==1 && pay_type.yfbpay.pay_type.includes('alipay')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/zfb.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								支付宝支付[Yfbpay]
							</view>
							<image v-if="pay_current == 25" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(43)" v-if="pay_type.yzf2pay && pay_type.yzf2pay.is_open == 1 && pay_type.yzf2pay.pay_type.includes('alipay')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/zfb.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								支付宝支付
							</view>
							<image v-if="pay_current == 43" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(45)" v-if="pay_type.yzf2pay && pay_type.yzf2pay.is_open == 1 && pay_type.yzf2pay.pay_type.includes('wechat')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/wx.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								微信支付
							</view>
							<image v-if="pay_current == 45" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(46)" v-if="pay_type.lfpay && pay_type.lfpay.is_open == 1 && pay_type.lfpay.pay_type.includes('quick')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/yhk.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								灵付快捷支付
							</view>
							<image v-if="pay_current == 46" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<view @click="payChange(47)" v-if="pay_type.lfpay && pay_type.lfpay.is_open == 1 && pay_type.lfpay.pay_type.includes('alipay')" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/zfb.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								灵付支付宝
							</view>
							<image v-if="pay_current == 47" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view>
					<!-- <view @click="payChange(37)" v-if="" class="w-100 u-border-bottom pb-30 mt-30" style="border-color: var(--gray-line) !important;">
						<view class="fr-ac">
							<image style="width: 40rpx;height: 40rpx;" src="/static/icon/public/ysf.png" mode=""></image>
							<view class="flex-1 op-90 mx-20">
								xxxx
							</view>
							<image v-if="pay_current == 37" class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check-fill.png" mode=""></image>
							<image v-else class="ml-auto" style="width: 24rpx;height: 24rpx;" src="/src/static/icon/public/check.png" mode=""></image>
						</view>
					</view> -->
				</template>
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				<view @click="is_agree=!is_agree" class="w-100 fr-ac mt-auto">
					<up-icon v-if="is_agree" name="yuanxingxuanzhongfill" customPrefix="custom-icon" size="16"
						:color="publicStyles['--color']"></up-icon>
					<up-icon v-else name="yuanxingweixuanzhong" customPrefix="custom-icon" size="16"
						:color="publicStyles['--color']"></up-icon>
					<view class="ml-10 fs-24">
						<text class="op-50">我已满18周岁&nbsp;已阅读同意</text>
						<text @click="$u.route(`/pages/parse/parse?type=4&title=用户协议`)" class="color">《用户协议》</text>
						<text class="op-50">和</text>
						<text @click="$u.route(`/pages/parse/parse?type=5&title=隐私政策`)" class="color">《隐私政策》</text>
					</view>
				</view>
				<view class="fr-ac gap-40 w-100 my-50">
					<view @click="close" class="public-btn-7 transition py-25 t-c flex-1">
						<view class="op-90 fs-32">
							取消
						</view>
					</view>
					<view @click="paySubmit" class="public-btn-4 transition py-25 t-c flex-2">
						<view class="text-color-b fs-32">
							确认
						</view>
					</view>
				</view>
			</view>
		</up-popup>
		
		<bank-card :show="bank_card.show"></bank-card>
	</view>
</template>

<script>
	import {
		useColorStore
	} from '@/store/color'
	import {
		index,
		infinite_ordermoney,
		infinite_orderbuy,
		
		get_user,
		recharge,
		
		warehouse_send_brow,
		warehouse_send,
		
		cardextractor_ordermoney,
		cardextractor_orderbuy,
		
		ordermoney,
		orderbuy,
		
		shop_goods_browse,
		shop_order_buy
		
	} from '@/utils/request/api';
	import {
		priceConversion
	} from '@/common/common'
	export default {
		props: {
			//是否显示
			show: {
				default: false,
				type:Boolean
			},
			height:{
				default: 1000
			},
			
			// 类型
			type:{
				default: ''
			},
			
			// 精粹订单购买相关
			goods_num:{
				default: ''
			},
			goods_num_type:{
				default: ''
			}, // 精气赏，抽卡功能用
			goods_id:{
				default: ''
			},
			
			// 提货相关
			take_goods: {
				default: []
			},
		},
		data() {
			return {
				is_agree: false,
				
				// 提货相关
				address: {},
				
				// 充值相关
				recharge_list: [],
				recharge_current: 0,
				recharge_num: '',
				
				
				// 精粹订单购买相关
				order_info: {
					goods: {}
				},
				
				// 支付渠道
				pay_type:{},
				pay_current: 3,
				
				use_integral_is: true, // 是否全款
				
				// 优惠券
				coupon:{
					id: ''
				},
				
				
				// 银行卡
				bank_card: {
					show: false
				},
				
				
				// 商品计数器
				goods_count: 1,
			};
		},
		computed: {
			publicStyles(){
				return useColorStore().publicStyles
			}
		},
		watch: {
			show: {
				async handler(newVal){
					if(!newVal){
						return
					}
					await this.get_index()
					console.log(newVal,'支付组件开关状态')
					switch (this.type){
						case 'yuanbao':
							await this.get_infinite_ordermoney()
							break;
						case 'chongzhi':
							await this.get_userApi()
							break;
						case 'tihuo':
							console.log(this.take_goods,'take_goods')
							await this.get_warehouse_send_brow()
							break;	
						case 'chouka':
							await this.get_cardextractor_ordermoney()
							break;	
						case 'yuanqi':
						case 'leitai':
						case 'yifan':
							await this.get_ordermoney()
							break;
						case 'shangcheng':
							this.goods_count = this.goods_num
							await this.get_shop_goods_browse()
							break;
						default:
							break;
					}
				},
				imediate: true,
			}
		},
		methods: {
			priceConversion,
			close(){
				this.$emit('close')
			},
			empty(){
				this.$emit('empty')
			},
			cancel(){
				this.$emit('cancel')
			},
			callback(order_num){
				this.$emit('callback',order_num)
			},
			// 数量选择器
			valChange(e,item){
				this.goods_count = e.value
				this.get_shop_goods_browse()
			},
			
			// 商城 下单
			async get_shop_goods_browse(){
				let params = {
					goods_id: this.goods_id,
				}
				if (this.order_info.goods.ks) {
					params.ks = this.order_info.goods.ks
					params.num = this.goods_count
					params.pay_type = this.pay_current
					params.is_integral = this.use_integral_is ? 1:0
				}
				const res = await shop_goods_browse(params)
				this.order_info = res
			},
			// 商城 购买
			async get_shop_order_buy(){
				if(!this.address.id){
					return uni.$u.toast('请选择收货地址')
				}
				if (!this.is_agree) {
					return uni.$u.toast('请阅读勾选协议')
				}
				const res = await shop_order_buy({
					goods_id: this.goods_id,
					ks: this.order_info.goods.ks,
					num: this.goods_count,
					pay_type: this.pay_current,
					is_integral: this.use_integral_is ? 1:0,
					
					mobile: this.address.mobile,
					name: this.address.name,
					address: this.address.str,
				})
				console.log('this.pay_current',this.pay_current)
				var obj = res.res
				if(obj){
					//epay支付
					if (this.pay_current == 33 || this.pay_current == 22) {
						var pay_url = obj.response.payurl
						console.log('epay支付', pay_url);
						uni.navigateTo({
							url: '/pages/webview?url=' + pay_url
						})
					} else if (this.pay_current == 35 || this.pay_current == 25) {
						if (this.pay_current == 35) {
							var pay_url = obj.response.data.url_scheme
						}
						if (this.pay_current == 25) {
							var pay_url = obj.response.data.alipay_url
						}
						console.log('yfbpay支付', res, pay_url);
						uni.navigateTo({
							url: '/pages/webview2?url=' + pay_url + '&order_no=' + res
								.order_num + '&path_type=' + res.res.attach
						})
					} else if (this.pay_current == 40) {
						var pay_url = obj.response.tn;
						console.log('hfpay支付', obj, pay_url);
						uni.navigateTo({
							url: '/pages/webview2?url=' + encodeURIComponent(pay_url) +
								'&order_no=' + obj
								.order_num + '&path_type=' + obj.attach
						})
					} else if (this.pay_current == 39) {
						return
						var pay_url = obj.response.qr_code
						this.qr_url = pay_url
						this.showQrcode(); //一加载生成二维码
						console.log('hfpay支付', res, pay_url);
						this.qr_callback_query.path_type = res.data.attach
						this.qr_callback_query.order_num = res.data.order_num
						uni.hideLoading()
					} else { //官方微信支付宝
						let provider = ['alipay', 'wxpay']
						let payinfo
						if (provider[this.pay_current - 2] == 'alipay') {
							payinfo = res.res.response
						}
						if (provider[this.pay_current - 2] == 'wxpay') {
							payinfo = res
						}
						console.log(payinfo, 'this.payinfo');
						uni.requestPayment({
							provider: provider[this.pay_current - 2],
							orderInfo: payinfo,
							success: () => {
								uni.showToast({
									title: '支付成功'
								})
							},
							fail(err) {
								uni.showToast({
									title: '支付失败',
									icon: "error"
								})
								console.log('fail:' + JSON.stringify(err));
							},
							complete() {
								uni.hideLoading()
							}
						})
					}
					
				}else{
					this.callback()
				}
			},
			
			// 精气赏 下单
			async get_ordermoney(){
				const res = await ordermoney({
					prize_num: this.goods_num,
					goods_id: this.goods_id,
					use_integral_is: this.use_integral_is ? 1:0,
					goods_num: this.goods_num_type,
					prize_num_type: (this.goods_num != 1 && this.goods_num != 3 && this.goods_num != 5)?1:0,
					coupon_id: this.coupon.id || '',
				})
				this.order_info = res
			},
			// 精气赏 支付
			async get_orderbuy(){
				if (!this.is_agree) {
					return uni.$u.toast('请阅读勾选协议')
				}
				const res = await orderbuy({
					prize_num: this.goods_num,
					goods_id: this.goods_id,
					use_integral_is: this.use_integral_is ? 1:0,
					goods_num: this.goods_num_type,
					prize_num_type: (this.goods_num != 1 && this.goods_num != 3 && this.goods_num != 5)?1:0,
					pay_type: this.pay_current,
					coupon_id: this.coupon.id || '',
				})
				this.callback(res.order_num)
			},
			
			// 抽卡下单
			async get_cardextractor_ordermoney(){
				const res = await cardextractor_ordermoney({
					prize_num_type: this.goods_num_type,
					goods_id: this.goods_id,
					use_integral_is: this.use_integral_is ? 1:0,
					coupon_id: this.coupon.id || '',
				})
				this.order_info = res
			},
			// 抽卡支付
			async get_cardextractor_orderbuy(){
				if (!this.is_agree) {
					return uni.$u.toast('请阅读勾选协议')
				}
				const result = await cardextractor_orderbuy({
					prize_num_type: this.goods_num_type,
					goods_id: this.goods_id,
					use_integral_is: this.use_integral_is ? 1:0,
					coupon_id: this.coupon.id || '',
					pay_type: this.pay_current
				})
				const { res } = result
				if(res){
					let provider =['alipay','wxpay']
					let orderInfo = {
						"appid": res.appid,
						"noncestr": res.noncestr, // 随机字符串
						"package": res.package,        // 固定值
						"partnerid": res.partnerid,      // 微信支付商户号
						"prepayid": res.prepayid, // 统一下单订单号
						"timestamp": res.timestamp,        // 时间戳（单位：秒）
						"sign": res.sign // 签名，这里用的 MD5/RSA 签名
					}
					
					uni.requestPayment({
						provider: provider[this.pay_current - 2],
						orderInfo:orderInfo,
						success: () => {
							this.callback(result.order_num)
						},
						fail(err) {
							uni.showToast({
								title:'支付失败',
								icon:"error"
							})
							console.log('fail:' + JSON.stringify(err));
						}
					})
				}else{
					this.callback(result.order_num)
				}
			},
			
			
			// 提货 选择地址
			addressChoose(){
				uni.navigateTo({
					url: `/pages/address/list`,
					events: {
						chooseAddress: (data)=>{
							console.log('===>', data);
							this.address = data
						}
					}
				})
			},
			async get_warehouse_send_brow(){
				const recovery_info = this.take_goods.map(item => {
					return {
						prize_code: item.prize_code,
						number: item.count,
						goods_type: item.goods_type,
					}
				})
				const res = await warehouse_send_brow({
					recovery_info: JSON.stringify(recovery_info),
					type: 1,
					use_integral_is: this.use_integral_is ? 1:0,
				})
				this.order_info = res
			},
			
			// 充值 获取充值信息
			async get_userApi(){
				const res = await get_user({})
				this.recharge_list = res.chongzhis
			},
			
			// 获取系统支付方式
			async get_index(){
				const res = await index({})
				this.pay_type = res.pay_type
			},
			
			// 准备下单
			async get_infinite_ordermoney(){
				const res = await infinite_ordermoney({
					prize_num: this.goods_num,
					goods_id: this.goods_id,
					use_integral_is: this.use_integral_is ? 1:0,
					coupon_id: this.coupon.id || '',
					prize_num_type: (this.goods_num != 1 && this.goods_num != 3 && this.goods_num != 5)?1:0,
				})
				this.order_info = res
				if(this.order_info.coupon_id == 0){
					this.coupon = {
						id: this.order_info.base_id,
						coupon_id: this.order_info.base_coupon_id,
						title: this.order_info.base_coupon_name,
					}
				}else{
					this.coupon = {}
				}
			},
			
			// 切换支付渠道
			payChange(e){
				if (e == 38 || e == 41 || e == 44) {
					switch (this.type){
						case 'yuanbao':
							this.use_integral_is = false
							this.get_infinite_ordermoney()
							break;
						case 'chongzhi':
							
							break;	
						case 'tihuo':
						
							break;
						default:
							break;
					}
				}
				if (this.pay_current == e) {
					return this.pay_current = 0
				}
				this.pay_current = e
			},
			
			// 选择优惠券
			couponChoose(){
				uni.navigateTo({
					url: `/pages/shopping/coupons?type=pay&goods_id=${this.goods_id}&total_price=${this.order_info.order_total}&state=${2}`,
					events: {
						chooseCoupon: async(data)=>{
							this.coupon = data
							console.log('===>', this.coupon);
							switch (this.type){
								case 'yuanbao':
									await this.get_infinite_ordermoney()
									break;
								case 'chongzhi':
									await this.get_userApi()
									break;
								case 'tihuo':
									console.log(this.take_goods,'take_goods')
									await this.get_warehouse_send_brow()
									break;	
								case 'chouka':
									await this.get_cardextractor_ordermoney()
									break;	
								case 'yuanqi':
								case 'leitai':
								case 'yifan':
									await this.get_ordermoney()
									break;
								case 'shangcheng':
									this.goods_count = this.goods_num
									await this.get_shop_goods_browse()
									break;
								default:
									break;
							}
						}
					}
				})
			},
			
			// 使用 / 不使用 精粹
			async use_integral_isChange(){
				if (this.pay_current == 38 || this.pay_current == 41 || this.pay_current == 44) {
					this.use_integral_is = false
					uni.showToast({
						title: '暂不支持与精粹同时支付',
						icon: 'none'
					})
				} else {
					this.use_integral_is = !this.use_integral_is
				}
				
				switch (this.type){
					case 'yuanbao':
						await this.get_infinite_ordermoney()
						break;
					case 'chongzhi':
						break;
					case 'tihuo':
						await this.get_warehouse_send_brow()
						break;	
					case 'chouka':
						await this.get_cardextractor_ordermoney()
						break;	
					case 'shangcheng':
						await this.get_shop_goods_browse()
						break;	
					default:
						break;
				}
			},
			
			// 确认支付
			async paySubmit() {
				switch (this.type){
					case 'yuanbao':
						await this.get_infinite_orderbuy()
						break;
					case 'chongzhi':
						await this.goRecharge()
						break;	
					case 'tihuo':
						await this.goTakePayment()
						break;	
					case 'chouka':
						await this.get_cardextractor_orderbuy()
						break;	
					case 'yuanqi':
					case 'leitai':
					case 'yifan':
						await this.get_orderbuy()
						break;	
					case 'shangcheng':
						await this.get_shop_order_buy()
						break;	
					default:
						break;
				}
				// 支付结束重置优惠券
				this.coupon = {}
			},
			
			// 提货 支付
			async goTakePayment(){
				if(!this.address.id){
					return uni.$u.toast('请选择收货地址')
				}
				if (!this.is_agree) {
					return uni.$u.toast('请阅读勾选协议')
				}
				const recovery_info = this.take_goods.map(item => {
					return {
						prize_code: item.prize_code,
						number: item.count,
					}
				})
				const {
					name,
					mobile,
					address,
					province,
					county,
					city
				} = this.address
				const result = await warehouse_send({
					type: 1,
					recovery_info: JSON.stringify(recovery_info),
					pay_type: this.pay_current,
					name,
					mobile,
					address: province + county + city + address,
					use_integral_is: this.use_integral_is ? 1:0,
				})
				const { res } = result
				if(res){
					let provider =['alipay','wxpay']
					let orderInfo = {
						"appid": res.appid,
						"noncestr": res.noncestr, // 随机字符串
						"package": res.package,        // 固定值
						"partnerid": res.partnerid,      // 微信支付商户号
						"prepayid": res.prepayid, // 统一下单订单号
						"timestamp": res.timestamp,        // 时间戳（单位：秒）
						"sign": res.sign // 签名，这里用的 MD5/RSA 签名
					}
					console.log(provider[this.pay_current - 2],this.pay_current);
					uni.requestPayment({
						provider: provider[this.pay_current - 2],
						orderInfo:orderInfo,
						success: () => {
							this.callback(result.order_no)
						},
						fail(err) {
							uni.showToast({
								title:'支付失败',
								icon:"error"
							})
							console.log('fail:' + JSON.stringify(err));
						}
					})
				}else{
					this.callback(result.order_no)
				}
			},
			
			// 充值
			async goRecharge(){
				// if (this.pay_current == 38) {
				// 	this.showQuickPayment = true
				// 	return
				// }
				// if (this.pay_current == 41) {
				// 	this.showQuickPayment2 = true
				// 	return
				// }
				let money = this.recharge_num > 0 ? this.recharge_num : this.recharge_list[this.recharge_current].name
				if(!money){
					return uni.$u.toast('请选择充值金额')
				}
				if(!this.pay_current){
					return uni.$u.toast('请选择支付方式')
				}
				if (!this.is_agree) {
					return uni.$u.toast('请阅读勾选协议')
				}
				this.close()
				
				
				const res = await recharge({
					id: this.recharge_num > 0 ? 0 : this.recharge_list[this.recharge_current].id,
					money: money,
					pay_type: this.pay_current
				})
				var obj = res
				console.log('obj', obj)
				uni.showLoading({
					title:'正在调取支付'
				})
				
				//epay支付
				if (this.pay_current == 33 || this.pay_current == 22 || this.pay_current == 37) {
					var pay_url = obj.response.payurl
					uni.navigateTo({
						url: '/pages/webview?url=' + encodeURIComponent(pay_url)
					})
				} else if (this.pay_current == 35 || this.pay_current == 25) {
					if (this.pay_current == 35) {
						var pay_url = obj.response.data.url_scheme
					}
					if (this.pay_current == 25) {
						var pay_url = obj.response.data.alipay_url
					}
					console.log('yfbpay支付', obj, pay_url);
					uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + obj
							.order_num + '&path_type=' + obj.attach
					})
				} else if (this.pay_current == 36) {
					var pay_url = obj.response.qr_code
					console.log('hfpay支付', obj, pay_url);
					uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + obj
							.order_num + '&path_type=' + obj.attach
					})
				} else if (this.pay_current == 38) {
					var pay_url = obj.response.form_url
					console.log('hfpay快捷支付', obj, pay_url);
					// #ifdef APP
					plus.runtime.openURL(pay_url)
					// #endif
					// #ifdef H5
					window.open(pay_url)
					// #endif
					uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + obj
							.order_num + '&path_type=' + obj.attach
					})
				} else if (this.pay_current == 41) {
					var pay_url = obj.response.form_url
					console.log('hfpay快捷支付', obj, pay_url);
					// #ifdef APP
					plus.runtime.openURL(pay_url)
					// #endif
					// #ifdef H5
					window.open(pay_url)
					// #endif
					uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + obj
							.order_num + '&path_type=' + obj.attach
					})
				} else if (this.pay_current == 46) {
					var pay_url = obj.response.form_url
					console.log('hfpay快捷支付', obj, pay_url);
					// #ifdef APP
					plus.runtime.openURL(pay_url)
					// #endif
					// #ifdef H5
					window.open(pay_url)
					// #endif
					uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + obj
							.order_num + '&path_type=' + obj.attach
					})
				} else if (this.pay_current == 47) {
					var pay_url = obj.response.data.payInfo
					console.log('hfpay快捷支付', obj, pay_url);
					// #ifdef APP
					plus.runtime.openURL(pay_url)
					// #endif
					// #ifdef H5
					window.open(pay_url)
					// #endif
					uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + obj
							.order_num + '&path_type=' + obj.attach
					})
				} else if (this.pay_current == 40) {
					var pay_url = obj.response.tn;
					console.log('hfpay支付', obj, pay_url);
					uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + obj
							.order_num + '&path_type=' + obj.attach
					})
				} else if (this.pay_current == 43 || this.pay_current == 45) {
					var pay_url = obj.response.payurl;
					uni.navigateTo({
						url: '/pages/webview?url=' + encodeURIComponent(pay_url)
					})
				} else if (this.pay_current == 44) {
					return
					console.log(obj.response.tn,'obj.response.tn');
					if(!checkAppInstalled()) {
						uni.hideLoading()
						return uni.showToast({
							title:'请先安装云闪付App',
							icon:'none'
						})
					}
					const tn = obj.response.tn//从后端接口中获取交易流水号(tn)
					// 发起支付
					startPay({
					    tn,
					    mode: "00",
					    // 在manifest.json->安卓/IOS常用其他设置->UrlSchemes中设置scheme
					    // scheme: "hbuilder",// 此处unionpayConsider替换为自己的Schemes
					    scheme: "bigplayer",// 此处unionpayConsider替换为自己的Schemes
					    result:res=>{
							// uni.showModal({
							// 	title:res.status,
							// 	content:res.sign
							// })
							if(res.status == 'success'){
								uni.showModal({
									title:'支付成功',
									showCancel:false,
									success: () => {
										uni.navigateBack()
									}
								})
							} else {
								uni.showModal({
									title:'支付失败',
									showCancel:false,
								})
							}
						},// 处理后续支付逻辑
					})
					// var pay_url = obj.response.url;
					// uni.navigateTo({
					// 	url: '/pages/webview?url=' + encodeURIComponent(pay_url)
					// })
				} else if (this.pay_current == 39) {
					return
					var pay_url = obj.response.qr_code
					this.qr_url = pay_url
					// this.$nextTick(()=>{
					// })
					this.showQrcode();//一加载生成二维码
			
					console.log('hfpay支付', res, pay_url);
					this.qr_callback_query.path_type = res.data.attach
					this.qr_callback_query.order_num = res.data.order_num
					/* 	uni.navigateTo({
						url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + res.data
							.order_num + '&path_type=' + res.data.attach
					}) */
				} else if (this.pay_current == 42) {
					console.log('res=====42=====res');
					console.log(obj);
					const payinfo = obj.response.data.orderStr;
					uni.requestPayment({
						provider: 'alipay',
						orderInfo: payinfo,
						success: (res) => {
							console.log('支付成功', res);
							// 处理支付成功的逻辑，比如更新订单状态等
						},
						fail: (err) => {
							console.log('支付失败', err);
							// 处理支付失败的逻辑
						}
					});
					/* 	let payUrl =`alipays://platformapi/startapp?saId=10000007&qrcode=${encodeURI(this.payinfo)}`;
						plus.runtime.openURL(payUrl); */
					/* console.log(this.payinfo, "this.payinfo");
					uni.requestPayment({
						provider: 'alipay',
						orderInfo: this.payinfo,
						success: () => {
							uni.showToast({
								title: '支付成功'
							})
						},
						fail(err) {
							uni.showToast({
								title: '支付失败',
								icon: "error"
							})
							console.log('fail:' + JSON.stringify(err));
						},
						complete() {
							uni.hideLoading()
						}
					}) */
				} else {
					let provider = ['alipay', 'wxpay']
					let payinfo
					if (provider[this.pay_current - 2] == 'alipay') {
						payinfo = obj.response
					}
					if (provider[this.pay_current - 2] == 'wxpay') {
						payinfo = obj
					}
					uni.requestPayment({
						provider: provider[this.pay_current - 2],
						orderInfo: payinfo,
						success: () => {
							uni.showToast({
								title: '支付成功'
							})
						},
						fail(err) {
							uni.showToast({
								title: '支付失败',
								icon: "error"
							})
							console.log('fail:' + JSON.stringify(err));
						},
						complete() {
							uni.hideLoading()
						}
					})
				}
				
				
				
				uni.hideLoading()
				this.callback(obj.order_num)
			},
			
			// 创建订单
			async get_infinite_orderbuy(){
				if (!this.is_agree) {
					return uni.$u.toast('请阅读勾选协议')
				}
				this.close()
				// if (this.pay_current == 38) {
				// 	this.showQuickPayment = true
				// 	return
				// }
				// if (this.pay_current == 41) {
				// 	this.showQuickPayment2 = true
				// 	return
				// }
				
				console.log(this.pay_current, 'pay_type');
				const res = await infinite_orderbuy({
					prize_num: this.goods_num,
					goods_id: this.goods_id,
					use_integral_is: this.use_integral_is ? 1:0,
					coupon_id: this.coupon.id || '',
					prize_num_type: (this.goods_num != 1 && this.goods_num != 3 && this.goods_num != 5)?1:0,
					
					pay_type: this.pay_current
				})
				console.log(res,'支付')
				if(res.res){
					// 支付渠道
					var obj = res.res
					console.log(obj, ' obj');
					uni.showLoading({
						title:'正在调取支付'
					})
					
					
					//epay支付
					if (this.pay_current == 33 || this.pay_current == 22 || this.pay_current == 37) {
						var pay_url = obj.response.payurl
						console.log('epay支付', pay_url);
						uni.navigateTo({
							url: '/pages/webview?url=' + encodeURIComponent(pay_url)
						})
					} else if (this.pay_current == 35 || this.pay_current == 25) {
						if (this.pay_current == 35) {
							var pay_url = obj.response.data.url_scheme
						}
						if (this.pay_current == 25) {
							var pay_url = obj.response.data.alipay_url
						}
						console.log('yfbpay支付', res, pay_url);
						uni.navigateTo({
							url: '/pages/webview2?url=' + pay_url + '&order_no=' + res
								.order_num + '&path_type=' + res.res.attach
						})
					} else if (this.pay_current == 43 || this.pay_current == 45) {
						var pay_url = obj.response.payurl;
						uni.navigateTo({
							url: '/pages/webview?url=' + encodeURIComponent(pay_url)
						})
					} else if (this.pay_current == 40) {
						var pay_url = obj.response.tn;
						console.log('hfpay支付', obj, pay_url);
						uni.navigateTo({
							url: '/pages/webview2?url=' + encodeURIComponent(pay_url) +
								'&order_no=' + obj
								.order_num + '&path_type=' + obj.attach
						})
					} else if (this.pay_current == 39) {
						return
						
						var pay_url = obj.response.qr_code
						console.log(pay_url);
						this.qr_url = pay_url
						
						this.showQrcode(); //一加载生成二维码
						console.log(obj.order_num);
						console.log(obj.attach);

						this.qr_callback_query.path_type = obj.attach
						this.qr_callback_query.order_num = obj.order_num
						/* 				uni.navigateTo({
											url: '/pages/webview2?url=' + encodeURIComponent(pay_url) + '&order_no=' + res.data
												.order_num + '&path_type=' + res.data.attach
										}) */
						//uni.hideLoading()
					} else if (this.pay_current == 44) {
						return
						
						console.log(obj.response.tn, 'obj.response.tn')
						if (!checkAppInstalled()) {
							uni.hideLoading()
							return uni.showToast({
								title: '请先安装云闪付App',
								icon: 'none'
							})
						}
						const tn = obj.response.tn //从后端接口中获取交易流水号(tn)
						// 发起支付
						startPay({
							tn,
							mode: "00",
							// 在manifest.json->安卓/IOS常用其他设置->UrlSchemes中设置scheme
							// scheme: "hbuilder",// 此处unionpayConsider替换为自己的Schemes
							scheme: "bigplayer", // 此处unionpayConsider替换为自己的Schemes
							result: res => {
								// uni.showModal({
								// 	title:res.status,
								// 	content:res.sign
								// })
								if (res.status == 'success') {
									this.infinite_prizeorderlog(obj.order_num)
								} else {
									uni.showModal({
										title: '支付失败',
										showCancel: false,
									})
								}
							}, // 处理后续支付逻辑
						})
					} else if (this.pay_current == 46) {
						var pay_url = obj.response.form_url
						console.log('hfpay快捷支付', res, pay_url);
						// #ifdef APP
						plus.runtime.openURL(pay_url)
						// #endif
						// #ifdef H5
						window.open(pay_url)
						// #endif
						uni.navigateTo({
							url: '/pages/webview2?url=' + encodeURIComponent(pay_url) +
								'&order_no=' + res
								.order_num + '&path_type=' + res.attach
						})
					} else if (this.pay_current == 47) {
						var pay_url = obj.response.data.payInfo
						console.log('hfpay快捷支付', obj, pay_url);
						// #ifdef APP
						plus.runtime.openURL(pay_url)
						// #endif
						// #ifdef H5
						window.open(pay_url)
						// #endif
						uni.navigateTo({
							url: '/pages/webview2?url=' + encodeURIComponent(pay_url) +
								'&order_no=' + res
								.order_num + '&path_type=' + res.attach
						})
					} else if (this.pay_current == 42) {
						const payinfo = obj.response.data.orderStr;
						uni.requestPayment({
							provider: 'alipay',
							orderInfo: payinfo,
							success: (res) => {
								console.log('支付成功', res);
								// 处理支付成功的逻辑，比如更新订单状态等
							},
							fail: (err) => {
								console.log('支付失败', err);
								// 处理支付失败的逻辑
							}
						});
						console.log(payinfo,'payinfo');
					} else { //官方微信支付宝
						let provider = ['alipay', 'wxpay']

						let orderInfo
						if (provider[this.pay_current - 2] == 'alipay') {
							orderInfo = obj.response
						}
						if (provider[this.pay_current - 2] == 'wxpay') {
							orderInfo = {
								"appid": obj.appid,
								"noncestr": obj.noncestr, // 随机字符串
								"package": obj.package, // 固定值
								"partnerid": obj.partnerid, // 微信支付商户号
								"prepayid": obj.prepayid, // 统一下单订单号
								"timestamp": obj.timestamp, // 时间戳（单位：秒）
								"sign": obj.sign // 签名，这里用的 MD5/RSA 签名
							}
						}
						uni.requestPayment({
							provider: provider[this.pay_current - 2],
							orderInfo: orderInfo,
							success: () => {
								this.callback(res.order_num)
							},
							fail(err) {
								uni.showToast({
									title: '支付失败',
									icon: "error"
								})
								console.log('fail:' + JSON.stringify(err));
							}
						})
					}
					
					
					
					uni.hideLoading()
				}else{
					// 精粹支付
					const order_num = res.order_num
					this.callback(order_num)
				}
				
			}
		}
	}
</script>

<style lang="scss">
	.good-box{
		position: relative;
		box-sizing: border-box;
		background-color: #fff ;
		z-index: 999;
		background: linear-gradient(to bottom, #17404D 0%, #001524 100%);
	}
	
	@media screen and (min-width:960px){
		.good-box{
			left: 50%;
			width: calc(750rpx);
			transform: translateX(-50%);
		}
	}
	@media screen and (max-width:960px){
		.good-box{
			left: 0;
			width: calc(100vw);
		}
	}
	
	.good-border{
		position: absolute;
		top: 0;
		left: 0;
		height: 2px;
		background: linear-gradient(to right, #184250 0%, #4EB5C8 25% , #E4FBFF 50% , #4EB5C8 75% , #184250 100%);
	}
	
	::v-deep .u-number-box__minus,.u-number-box__plus{
		background-color: transparent !important;
	}
</style>